Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevents text color from changing on hover for "inactive" ActionMenu.Items of the "danger" variant #4651

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

mperrotti
Copy link
Contributor

Closes # No issue created.See Slack comment (GitHub staff only).

Demo of fix

The fourth item, "Make a copy", is variant="danger" and has inactiveText set. Before this change, the text color would change on hover. After this change, the text color remains the same.

Before:

Kapture.2024-06-07.at.08.47.09.mp4

After:

Kapture.2024-06-07.at.08.34.08.mp4

Changelog

New

Changed

Increases specificity of the :hover styles to exclude inactive items.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Try and hover the fourth item ("Make a copy") in the menu of the ActionMenu/Features/Inactive items story. VRTs should cover regressions.

Merge checklist

@mperrotti mperrotti requested a review from a team as a code owner June 7, 2024 13:03
@mperrotti mperrotti requested a review from keithamus June 7, 2024 13:03
Copy link

changeset-bot bot commented Jun 7, 2024

🦋 Changeset detected

Latest commit: f3db868

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

'[data-variant="danger"]:hover &, [data-variant="danger"]:active &': {
color: getVariantStyles(variant, disabled, inactive).hoverColor,
},
'[data-variant="danger"]:not([aria-disabled]):not([data-inactive]):hover &, [data-variant="danger"]:active &':
Copy link
Contributor Author

@mperrotti mperrotti Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that these styles affect the color of sibling nodes is kind of weird. Should we do a refactor as part of this PR? I was afraid to touch it and break things.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait till we refactor to CSS modules 😂

Copy link
Contributor

github-actions bot commented Jun 7, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.63 KB (+0.02% 🔺)
packages/react/dist/browser.umd.js 89.89 KB (-0.04% 🔽)

@mperrotti mperrotti enabled auto-merge June 17, 2024 14:52
@mperrotti mperrotti added this pull request to the merge queue Jun 17, 2024
Merged via the queue into main with commit b13bbb3 Jun 17, 2024
30 checks passed
@mperrotti mperrotti deleted the mp/inactive-danger-hover-fix branch June 17, 2024 15:13
@primer primer bot mentioned this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants